/*RatingsGrid = Ext.extend(Ext.grid.GridPanel, {
     border:false
    ,initComponent:function() {
        Ext.apply(this, {
            store: new Ext.data.SimpleStore({			
		        fields: [
		           {name: 'name'},
		           {name: 'rating', type: 'int'}           
		        ]
			}),
	        columns: [
	            {id:'name',header: "Name", width: 150, sortable: true, dataIndex: 'name'},
	            {header: "Rating", width: 100, sortable: true, dataIndex: 'rating'}            
	        ],
	        stripeRows: true,
	        autoExpandColumn: 'name',
	        height:350,
	        width:250,
	        title:'Players Ratings'
        });
 
        RatingsGrid.superclass.initComponent.apply(this, arguments);
    } // eo function initComponent
 
    ,onRender:function() {
        this.store.load();
 
        RatingsGrid.superclass.onRender.apply(this, arguments);
    } // eo function onRender
});*/


function buildGrid(data) {

    // create the data store
    var store = new Ext.data.SimpleStore({
        fields: [
           {name: 'name'},
           {name: 'rating', type: 'int'}           
        ]
    });
    store.loadData(data);
	
    // create the Grid
    var grid = new Ext.grid.GridPanel({
        store: store,
        columns: [
            {id:'name',header: "Name", width: 150, sortable: true, dataIndex: 'name'},
            {header: "Rating", width: 100, sortable: true, dataIndex: 'rating'}            
        ],
        stripeRows: true,
        autoExpandColumn: 'name',
        height:350,
        width:250,
        title:'Players Ratings'
    });   
    	
	return grid;
}